import org.junit.Test;

import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class EncodeDate {

    @Test
    public void testDate() throws Exception {
        String format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now());
        System.out.println(format);
        String encodeDate = URLEncoder.encode(format, "UTF-8");
        System.out.println(encodeDate);
    }
}
